import axios from "@/api/config"
import {baseURL} from "@/api/ipconfig"

var ip = baseURL.URL1

export async function getHotWord(data) {//获取热词
    const url = ip+'/ssea/network/hotWordIndexAnalysis/'+data;
    const res = await axios.get(url);
    return res.data;
}
export async function getNetworkLogo() {//获取融头条logo
    const url = ip+'/ssea/network/headlines';
    const res = await axios.get(url);
    return res.data;
}
export async function getNewsList(data) {//获取融头条新闻列表
    if(data.columnName === ''){
        var url = ip+'/ssea/network/headline?siteName='+encodeURI(data.siteName);
    } else {
        var url = ip+'/ssea/network/headline?columnName='+encodeURI(data.columnName)+'&siteName='+encodeURI(data.siteName);
    }
    const res = await axios.get(url);
    return res.data;
}
export async function newsClick(data) {//点击新闻
    const url = ip+'/ssea/network/click?id='+data;
    const res = await axios.put(url);
    return res.data;
}